//
//  MYGoodDetailCell.m
//  MiYuan_iOS
//
//  Created by zhangyongbing on 2018/7/12.
//  Copyright © 2018年 zhangyongbing. All rights reserved.
//

#import "MYGoodDetailCell.h"

@implementation MYGoodDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setDataToViewWithDictionary:(NSDictionary *)dic
{
    NSString *imgurl = [NSString stringWithFormat:@"%@",[dic objectForKey:@"picture"]];
    if ([imgurl stringIsValid]) {
        [self.imgIcon sd_setImageWithURL:[NSURL URLWithString:imgurl] placeholderImage:[UIImage imageNamed:@"deafultgood"]];
    }
    else{
        [self.imgIcon setImage:[UIImage imageNamed:@"deafultgood"]];
    }
    
    NSString *name = [NSString stringWithFormat:@"%@",[dic objectForKey:@"name"]];
    if ([name stringIsValid]) {
        [self.labTitle setText:name];
    }
    else
    {
        [self.labTitle setText:@""];
    }
    
    
    NSString *sold = [NSString stringWithFormat:@"%@",[dic objectForKey:@"sold"]];//售卖
    NSString *strpassagewayNumber = [NSString stringWithFormat:@"%@",[dic objectForKey:@"passagewayNumber"]];
    [self.labRestocking setText:sold];
    [self.labpassagewayNumber setText:strpassagewayNumber];
}

@end
